package com.yusheng.controller;

import com.yusheng.dao.QueryAppproval;
import com.yusheng.entity.ApprovalRecordList;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;

@WebServlet(name = "ApprovalDetail1", value = "/ApprovalDetail1")
public class ApprovalDetail1 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //获取审批人编号参数
        String stuffNo=request.getParameter("stuffno");
        //根据编号到审批表里面获取审批记录
        ApprovalRecordList approvalRecordList= QueryAppproval.getApprovalsByApprovalNo(stuffNo);
        System.out.println("获取到了数据");
        //审批记录放在请求中,用来共享数据
        request.setAttribute("approvalList",approvalRecordList);
        //转发请求给    approvalDetail1.jsp
        RequestDispatcher report=request.getRequestDispatcher("/ApprovalDetail1.jsp");
        report.forward(request,response);

    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doPost(req, resp);
    }
}
